<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:a="livcos.org/ns/admin"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:v="livcos.org/ns/view"
	exclude-result-prefixes="a v">
	
	<xsl:import href="location.xsl" />
  
	<xsl:template match="a:company">
		<div id="{@id}" class="company">
			<v:style ref="{resolve-uri('styles.css')}"/>
			<p><xsl:value-of select="a:title" /></p>
			<xsl:apply-templates select="a:address[@type = 'main']"/>
			<p><xsl:apply-templates select="a:phone[@type = 'main']"/></p>
			<p><xsl:apply-templates select="a:email[@type = 'info']"/></p>
		</div>
	</xsl:template>
	
	<xsl:template match="a:person">
		<div id="{@id}" class="person">
			<v:style ref="{resolve-uri('styles.css')}"/>
			<p><xsl:value-of select="a:name/a:first"/><xsl:text> </xsl:text><xsl:value-of select="a:name/a:last"/></p>
			<xsl:apply-templates select="a:address"/>
			<xsl:for-each select="a:phone">
				<p><xsl:apply-templates select="."/></p>
			</xsl:for-each>
			<xsl:for-each select="a:email">
				<p><xsl:apply-templates select="."/></p>
			</xsl:for-each>
		</div>
	</xsl:template>
	
</xsl:stylesheet>
